#pragma once
// MESSAGE PRICISE_IMU PACKING

#define MAVLINK_MSG_ID_PRICISE_IMU 19

MAVPACKED(
typedef struct __mavlink_pricise_imu_t {
 uint64_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
 float xgyro; /*<  The x axis gyro(-838.8608..838.8608).*/
 float ygyro; /*<  The y axis gyro(-838.8608..838.8608).*/
 float zgyro; /*<  The z axis gyro(-838.8608..838.8608).*/
 float xacc; /*<  The x axis acc(-83.88608..83.88608).*/
 float yacc; /*<  The y axis acc(-83.88608..83.88608).*/
 float zacc; /*<  The z axis acc(-83.88608..83.88608).*/
 float xmagn; /*<  The x axis magn(-327.68..327.68).*/
 float ymagn; /*<  The y axis magn(-327.68..327.68).*/
 float zmagn; /*<  The z axis magn(-327.68..327.68).*/
 float Hbar; /*<  The Hbar(0..6553.6).*/
 float pitch; /*<  The pitch(-90..90).*/
 float roll; /*<  The roll(-180..180).*/
 float yaw; /*<  The yaw(0,360).*/
 float vel_e; /*<  The east vel(-838.8608..838.8608).*/
 float vel_n; /*<  The north vel(-838.8608..838.8608).*/
 float vel_u; /*<  The up vel(-838.8608..838.8608).*/
 float longitude; /*<  The longitude(-838.8608..838.8608).*/
 float latitude; /*<  latitude(-838.8608..838.8608).*/
 float hight; /*<  The hight(-838.8608..838.8608).*/
 uint8_t magnFlg; /*<  valid component(0:invalid 1:valid).*/
 uint8_t HbarFlg; /*<  valid component(0:invalid 1:valid).*/
 uint8_t mode; /*<  mode component(1..3).*/
 uint8_t scene; /*<  scene component(1..5).*/
}) mavlink_pricise_imu_t;

#define MAVLINK_MSG_ID_PRICISE_IMU_LEN 88
#define MAVLINK_MSG_ID_PRICISE_IMU_MIN_LEN 88
#define MAVLINK_MSG_ID_19_LEN 88
#define MAVLINK_MSG_ID_19_MIN_LEN 88

#define MAVLINK_MSG_ID_PRICISE_IMU_CRC 38
#define MAVLINK_MSG_ID_19_CRC 38



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_PRICISE_IMU { \
    19, \
    "PRICISE_IMU", \
    24, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_pricise_imu_t, time_boot_ms) }, \
         { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_pricise_imu_t, xgyro) }, \
         { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_pricise_imu_t, ygyro) }, \
         { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_pricise_imu_t, zgyro) }, \
         { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_pricise_imu_t, xacc) }, \
         { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_pricise_imu_t, yacc) }, \
         { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_pricise_imu_t, zacc) }, \
         { "xmagn", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_pricise_imu_t, xmagn) }, \
         { "ymagn", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_pricise_imu_t, ymagn) }, \
         { "zmagn", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_pricise_imu_t, zmagn) }, \
         { "magnFlg", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_pricise_imu_t, magnFlg) }, \
         { "Hbar", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_pricise_imu_t, Hbar) }, \
         { "HbarFlg", NULL, MAVLINK_TYPE_UINT8_T, 0, 85, offsetof(mavlink_pricise_imu_t, HbarFlg) }, \
         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_pricise_imu_t, pitch) }, \
         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_pricise_imu_t, roll) }, \
         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_pricise_imu_t, yaw) }, \
         { "vel_e", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_pricise_imu_t, vel_e) }, \
         { "vel_n", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_pricise_imu_t, vel_n) }, \
         { "vel_u", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_pricise_imu_t, vel_u) }, \
         { "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_pricise_imu_t, longitude) }, \
         { "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_pricise_imu_t, latitude) }, \
         { "hight", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_pricise_imu_t, hight) }, \
         { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 86, offsetof(mavlink_pricise_imu_t, mode) }, \
         { "scene", NULL, MAVLINK_TYPE_UINT8_T, 0, 87, offsetof(mavlink_pricise_imu_t, scene) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_PRICISE_IMU { \
    "PRICISE_IMU", \
    24, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_pricise_imu_t, time_boot_ms) }, \
         { "xgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_pricise_imu_t, xgyro) }, \
         { "ygyro", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_pricise_imu_t, ygyro) }, \
         { "zgyro", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_pricise_imu_t, zgyro) }, \
         { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_pricise_imu_t, xacc) }, \
         { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_pricise_imu_t, yacc) }, \
         { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_pricise_imu_t, zacc) }, \
         { "xmagn", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_pricise_imu_t, xmagn) }, \
         { "ymagn", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_pricise_imu_t, ymagn) }, \
         { "zmagn", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_pricise_imu_t, zmagn) }, \
         { "magnFlg", NULL, MAVLINK_TYPE_UINT8_T, 0, 84, offsetof(mavlink_pricise_imu_t, magnFlg) }, \
         { "Hbar", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_pricise_imu_t, Hbar) }, \
         { "HbarFlg", NULL, MAVLINK_TYPE_UINT8_T, 0, 85, offsetof(mavlink_pricise_imu_t, HbarFlg) }, \
         { "pitch", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_pricise_imu_t, pitch) }, \
         { "roll", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_pricise_imu_t, roll) }, \
         { "yaw", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_pricise_imu_t, yaw) }, \
         { "vel_e", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_pricise_imu_t, vel_e) }, \
         { "vel_n", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_pricise_imu_t, vel_n) }, \
         { "vel_u", NULL, MAVLINK_TYPE_FLOAT, 0, 68, offsetof(mavlink_pricise_imu_t, vel_u) }, \
         { "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 72, offsetof(mavlink_pricise_imu_t, longitude) }, \
         { "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 76, offsetof(mavlink_pricise_imu_t, latitude) }, \
         { "hight", NULL, MAVLINK_TYPE_FLOAT, 0, 80, offsetof(mavlink_pricise_imu_t, hight) }, \
         { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 86, offsetof(mavlink_pricise_imu_t, mode) }, \
         { "scene", NULL, MAVLINK_TYPE_UINT8_T, 0, 87, offsetof(mavlink_pricise_imu_t, scene) }, \
         } \
}
#endif

/**
 * @brief Pack a pricise_imu message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param time_boot_ms [ms] Timestamp (time since system boot).
 * @param xgyro  The x axis gyro(-838.8608..838.8608).
 * @param ygyro  The y axis gyro(-838.8608..838.8608).
 * @param zgyro  The z axis gyro(-838.8608..838.8608).
 * @param xacc  The x axis acc(-83.88608..83.88608).
 * @param yacc  The y axis acc(-83.88608..83.88608).
 * @param zacc  The z axis acc(-83.88608..83.88608).
 * @param xmagn  The x axis magn(-327.68..327.68).
 * @param ymagn  The y axis magn(-327.68..327.68).
 * @param zmagn  The z axis magn(-327.68..327.68).
 * @param magnFlg  valid component(0:invalid 1:valid).
 * @param Hbar  The Hbar(0..6553.6).
 * @param HbarFlg  valid component(0:invalid 1:valid).
 * @param pitch  The pitch(-90..90).
 * @param roll  The roll(-180..180).
 * @param yaw  The yaw(0,360).
 * @param vel_e  The east vel(-838.8608..838.8608).
 * @param vel_n  The north vel(-838.8608..838.8608).
 * @param vel_u  The up vel(-838.8608..838.8608).
 * @param longitude  The longitude(-838.8608..838.8608).
 * @param latitude  latitude(-838.8608..838.8608).
 * @param hight  The hight(-838.8608..838.8608).
 * @param mode  mode component(1..3).
 * @param scene  scene component(1..5).
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_pricise_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               uint64_t time_boot_ms, float xgyro, float ygyro, float zgyro, float xacc, float yacc, float zacc, float xmagn, float ymagn, float zmagn, uint8_t magnFlg, float Hbar, uint8_t HbarFlg, float pitch, float roll, float yaw, float vel_e, float vel_n, float vel_u, float longitude, float latitude, float hight, uint8_t mode, uint8_t scene)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_PRICISE_IMU_LEN];
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, xgyro);
    _mav_put_float(buf, 12, ygyro);
    _mav_put_float(buf, 16, zgyro);
    _mav_put_float(buf, 20, xacc);
    _mav_put_float(buf, 24, yacc);
    _mav_put_float(buf, 28, zacc);
    _mav_put_float(buf, 32, xmagn);
    _mav_put_float(buf, 36, ymagn);
    _mav_put_float(buf, 40, zmagn);
    _mav_put_float(buf, 44, Hbar);
    _mav_put_float(buf, 48, pitch);
    _mav_put_float(buf, 52, roll);
    _mav_put_float(buf, 56, yaw);
    _mav_put_float(buf, 60, vel_e);
    _mav_put_float(buf, 64, vel_n);
    _mav_put_float(buf, 68, vel_u);
    _mav_put_float(buf, 72, longitude);
    _mav_put_float(buf, 76, latitude);
    _mav_put_float(buf, 80, hight);
    _mav_put_uint8_t(buf, 84, magnFlg);
    _mav_put_uint8_t(buf, 85, HbarFlg);
    _mav_put_uint8_t(buf, 86, mode);
    _mav_put_uint8_t(buf, 87, scene);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PRICISE_IMU_LEN);
#else
    mavlink_pricise_imu_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.xgyro = xgyro;
    packet.ygyro = ygyro;
    packet.zgyro = zgyro;
    packet.xacc = xacc;
    packet.yacc = yacc;
    packet.zacc = zacc;
    packet.xmagn = xmagn;
    packet.ymagn = ymagn;
    packet.zmagn = zmagn;
    packet.Hbar = Hbar;
    packet.pitch = pitch;
    packet.roll = roll;
    packet.yaw = yaw;
    packet.vel_e = vel_e;
    packet.vel_n = vel_n;
    packet.vel_u = vel_u;
    packet.longitude = longitude;
    packet.latitude = latitude;
    packet.hight = hight;
    packet.magnFlg = magnFlg;
    packet.HbarFlg = HbarFlg;
    packet.mode = mode;
    packet.scene = scene;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PRICISE_IMU_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_PRICISE_IMU;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PRICISE_IMU_MIN_LEN, MAVLINK_MSG_ID_PRICISE_IMU_LEN, MAVLINK_MSG_ID_PRICISE_IMU_CRC);
}

/**
 * @brief Pack a pricise_imu message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param time_boot_ms [ms] Timestamp (time since system boot).
 * @param xgyro  The x axis gyro(-838.8608..838.8608).
 * @param ygyro  The y axis gyro(-838.8608..838.8608).
 * @param zgyro  The z axis gyro(-838.8608..838.8608).
 * @param xacc  The x axis acc(-83.88608..83.88608).
 * @param yacc  The y axis acc(-83.88608..83.88608).
 * @param zacc  The z axis acc(-83.88608..83.88608).
 * @param xmagn  The x axis magn(-327.68..327.68).
 * @param ymagn  The y axis magn(-327.68..327.68).
 * @param zmagn  The z axis magn(-327.68..327.68).
 * @param magnFlg  valid component(0:invalid 1:valid).
 * @param Hbar  The Hbar(0..6553.6).
 * @param HbarFlg  valid component(0:invalid 1:valid).
 * @param pitch  The pitch(-90..90).
 * @param roll  The roll(-180..180).
 * @param yaw  The yaw(0,360).
 * @param vel_e  The east vel(-838.8608..838.8608).
 * @param vel_n  The north vel(-838.8608..838.8608).
 * @param vel_u  The up vel(-838.8608..838.8608).
 * @param longitude  The longitude(-838.8608..838.8608).
 * @param latitude  latitude(-838.8608..838.8608).
 * @param hight  The hight(-838.8608..838.8608).
 * @param mode  mode component(1..3).
 * @param scene  scene component(1..5).
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_pricise_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   uint64_t time_boot_ms,float xgyro,float ygyro,float zgyro,float xacc,float yacc,float zacc,float xmagn,float ymagn,float zmagn,uint8_t magnFlg,float Hbar,uint8_t HbarFlg,float pitch,float roll,float yaw,float vel_e,float vel_n,float vel_u,float longitude,float latitude,float hight,uint8_t mode,uint8_t scene)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_PRICISE_IMU_LEN];
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, xgyro);
    _mav_put_float(buf, 12, ygyro);
    _mav_put_float(buf, 16, zgyro);
    _mav_put_float(buf, 20, xacc);
    _mav_put_float(buf, 24, yacc);
    _mav_put_float(buf, 28, zacc);
    _mav_put_float(buf, 32, xmagn);
    _mav_put_float(buf, 36, ymagn);
    _mav_put_float(buf, 40, zmagn);
    _mav_put_float(buf, 44, Hbar);
    _mav_put_float(buf, 48, pitch);
    _mav_put_float(buf, 52, roll);
    _mav_put_float(buf, 56, yaw);
    _mav_put_float(buf, 60, vel_e);
    _mav_put_float(buf, 64, vel_n);
    _mav_put_float(buf, 68, vel_u);
    _mav_put_float(buf, 72, longitude);
    _mav_put_float(buf, 76, latitude);
    _mav_put_float(buf, 80, hight);
    _mav_put_uint8_t(buf, 84, magnFlg);
    _mav_put_uint8_t(buf, 85, HbarFlg);
    _mav_put_uint8_t(buf, 86, mode);
    _mav_put_uint8_t(buf, 87, scene);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PRICISE_IMU_LEN);
#else
    mavlink_pricise_imu_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.xgyro = xgyro;
    packet.ygyro = ygyro;
    packet.zgyro = zgyro;
    packet.xacc = xacc;
    packet.yacc = yacc;
    packet.zacc = zacc;
    packet.xmagn = xmagn;
    packet.ymagn = ymagn;
    packet.zmagn = zmagn;
    packet.Hbar = Hbar;
    packet.pitch = pitch;
    packet.roll = roll;
    packet.yaw = yaw;
    packet.vel_e = vel_e;
    packet.vel_n = vel_n;
    packet.vel_u = vel_u;
    packet.longitude = longitude;
    packet.latitude = latitude;
    packet.hight = hight;
    packet.magnFlg = magnFlg;
    packet.HbarFlg = HbarFlg;
    packet.mode = mode;
    packet.scene = scene;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PRICISE_IMU_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_PRICISE_IMU;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PRICISE_IMU_MIN_LEN, MAVLINK_MSG_ID_PRICISE_IMU_LEN, MAVLINK_MSG_ID_PRICISE_IMU_CRC);
}

/**
 * @brief Encode a pricise_imu struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param pricise_imu C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_pricise_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_pricise_imu_t* pricise_imu)
{
    return mavlink_msg_pricise_imu_pack(system_id, component_id, msg, pricise_imu->time_boot_ms, pricise_imu->xgyro, pricise_imu->ygyro, pricise_imu->zgyro, pricise_imu->xacc, pricise_imu->yacc, pricise_imu->zacc, pricise_imu->xmagn, pricise_imu->ymagn, pricise_imu->zmagn, pricise_imu->magnFlg, pricise_imu->Hbar, pricise_imu->HbarFlg, pricise_imu->pitch, pricise_imu->roll, pricise_imu->yaw, pricise_imu->vel_e, pricise_imu->vel_n, pricise_imu->vel_u, pricise_imu->longitude, pricise_imu->latitude, pricise_imu->hight, pricise_imu->mode, pricise_imu->scene);
}

/**
 * @brief Encode a pricise_imu struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param pricise_imu C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_pricise_imu_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_pricise_imu_t* pricise_imu)
{
    return mavlink_msg_pricise_imu_pack_chan(system_id, component_id, chan, msg, pricise_imu->time_boot_ms, pricise_imu->xgyro, pricise_imu->ygyro, pricise_imu->zgyro, pricise_imu->xacc, pricise_imu->yacc, pricise_imu->zacc, pricise_imu->xmagn, pricise_imu->ymagn, pricise_imu->zmagn, pricise_imu->magnFlg, pricise_imu->Hbar, pricise_imu->HbarFlg, pricise_imu->pitch, pricise_imu->roll, pricise_imu->yaw, pricise_imu->vel_e, pricise_imu->vel_n, pricise_imu->vel_u, pricise_imu->longitude, pricise_imu->latitude, pricise_imu->hight, pricise_imu->mode, pricise_imu->scene);
}

/**
 * @brief Send a pricise_imu message
 * @param chan MAVLink channel to send the message
 *
 * @param time_boot_ms [ms] Timestamp (time since system boot).
 * @param xgyro  The x axis gyro(-838.8608..838.8608).
 * @param ygyro  The y axis gyro(-838.8608..838.8608).
 * @param zgyro  The z axis gyro(-838.8608..838.8608).
 * @param xacc  The x axis acc(-83.88608..83.88608).
 * @param yacc  The y axis acc(-83.88608..83.88608).
 * @param zacc  The z axis acc(-83.88608..83.88608).
 * @param xmagn  The x axis magn(-327.68..327.68).
 * @param ymagn  The y axis magn(-327.68..327.68).
 * @param zmagn  The z axis magn(-327.68..327.68).
 * @param magnFlg  valid component(0:invalid 1:valid).
 * @param Hbar  The Hbar(0..6553.6).
 * @param HbarFlg  valid component(0:invalid 1:valid).
 * @param pitch  The pitch(-90..90).
 * @param roll  The roll(-180..180).
 * @param yaw  The yaw(0,360).
 * @param vel_e  The east vel(-838.8608..838.8608).
 * @param vel_n  The north vel(-838.8608..838.8608).
 * @param vel_u  The up vel(-838.8608..838.8608).
 * @param longitude  The longitude(-838.8608..838.8608).
 * @param latitude  latitude(-838.8608..838.8608).
 * @param hight  The hight(-838.8608..838.8608).
 * @param mode  mode component(1..3).
 * @param scene  scene component(1..5).
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_pricise_imu_send(mavlink_channel_t chan, uint64_t time_boot_ms, float xgyro, float ygyro, float zgyro, float xacc, float yacc, float zacc, float xmagn, float ymagn, float zmagn, uint8_t magnFlg, float Hbar, uint8_t HbarFlg, float pitch, float roll, float yaw, float vel_e, float vel_n, float vel_u, float longitude, float latitude, float hight, uint8_t mode, uint8_t scene)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_PRICISE_IMU_LEN];
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, xgyro);
    _mav_put_float(buf, 12, ygyro);
    _mav_put_float(buf, 16, zgyro);
    _mav_put_float(buf, 20, xacc);
    _mav_put_float(buf, 24, yacc);
    _mav_put_float(buf, 28, zacc);
    _mav_put_float(buf, 32, xmagn);
    _mav_put_float(buf, 36, ymagn);
    _mav_put_float(buf, 40, zmagn);
    _mav_put_float(buf, 44, Hbar);
    _mav_put_float(buf, 48, pitch);
    _mav_put_float(buf, 52, roll);
    _mav_put_float(buf, 56, yaw);
    _mav_put_float(buf, 60, vel_e);
    _mav_put_float(buf, 64, vel_n);
    _mav_put_float(buf, 68, vel_u);
    _mav_put_float(buf, 72, longitude);
    _mav_put_float(buf, 76, latitude);
    _mav_put_float(buf, 80, hight);
    _mav_put_uint8_t(buf, 84, magnFlg);
    _mav_put_uint8_t(buf, 85, HbarFlg);
    _mav_put_uint8_t(buf, 86, mode);
    _mav_put_uint8_t(buf, 87, scene);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PRICISE_IMU, buf, MAVLINK_MSG_ID_PRICISE_IMU_MIN_LEN, MAVLINK_MSG_ID_PRICISE_IMU_LEN, MAVLINK_MSG_ID_PRICISE_IMU_CRC);
#else
    mavlink_pricise_imu_t packet;
    packet.time_boot_ms = time_boot_ms;
    packet.xgyro = xgyro;
    packet.ygyro = ygyro;
    packet.zgyro = zgyro;
    packet.xacc = xacc;
    packet.yacc = yacc;
    packet.zacc = zacc;
    packet.xmagn = xmagn;
    packet.ymagn = ymagn;
    packet.zmagn = zmagn;
    packet.Hbar = Hbar;
    packet.pitch = pitch;
    packet.roll = roll;
    packet.yaw = yaw;
    packet.vel_e = vel_e;
    packet.vel_n = vel_n;
    packet.vel_u = vel_u;
    packet.longitude = longitude;
    packet.latitude = latitude;
    packet.hight = hight;
    packet.magnFlg = magnFlg;
    packet.HbarFlg = HbarFlg;
    packet.mode = mode;
    packet.scene = scene;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PRICISE_IMU, (const char *)&packet, MAVLINK_MSG_ID_PRICISE_IMU_MIN_LEN, MAVLINK_MSG_ID_PRICISE_IMU_LEN, MAVLINK_MSG_ID_PRICISE_IMU_CRC);
#endif
}

/**
 * @brief Send a pricise_imu message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_pricise_imu_send_struct(mavlink_channel_t chan, const mavlink_pricise_imu_t* pricise_imu)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_pricise_imu_send(chan, pricise_imu->time_boot_ms, pricise_imu->xgyro, pricise_imu->ygyro, pricise_imu->zgyro, pricise_imu->xacc, pricise_imu->yacc, pricise_imu->zacc, pricise_imu->xmagn, pricise_imu->ymagn, pricise_imu->zmagn, pricise_imu->magnFlg, pricise_imu->Hbar, pricise_imu->HbarFlg, pricise_imu->pitch, pricise_imu->roll, pricise_imu->yaw, pricise_imu->vel_e, pricise_imu->vel_n, pricise_imu->vel_u, pricise_imu->longitude, pricise_imu->latitude, pricise_imu->hight, pricise_imu->mode, pricise_imu->scene);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PRICISE_IMU, (const char *)pricise_imu, MAVLINK_MSG_ID_PRICISE_IMU_MIN_LEN, MAVLINK_MSG_ID_PRICISE_IMU_LEN, MAVLINK_MSG_ID_PRICISE_IMU_CRC);
#endif
}

#if MAVLINK_MSG_ID_PRICISE_IMU_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_pricise_imu_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_boot_ms, float xgyro, float ygyro, float zgyro, float xacc, float yacc, float zacc, float xmagn, float ymagn, float zmagn, uint8_t magnFlg, float Hbar, uint8_t HbarFlg, float pitch, float roll, float yaw, float vel_e, float vel_n, float vel_u, float longitude, float latitude, float hight, uint8_t mode, uint8_t scene)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_uint64_t(buf, 0, time_boot_ms);
    _mav_put_float(buf, 8, xgyro);
    _mav_put_float(buf, 12, ygyro);
    _mav_put_float(buf, 16, zgyro);
    _mav_put_float(buf, 20, xacc);
    _mav_put_float(buf, 24, yacc);
    _mav_put_float(buf, 28, zacc);
    _mav_put_float(buf, 32, xmagn);
    _mav_put_float(buf, 36, ymagn);
    _mav_put_float(buf, 40, zmagn);
    _mav_put_float(buf, 44, Hbar);
    _mav_put_float(buf, 48, pitch);
    _mav_put_float(buf, 52, roll);
    _mav_put_float(buf, 56, yaw);
    _mav_put_float(buf, 60, vel_e);
    _mav_put_float(buf, 64, vel_n);
    _mav_put_float(buf, 68, vel_u);
    _mav_put_float(buf, 72, longitude);
    _mav_put_float(buf, 76, latitude);
    _mav_put_float(buf, 80, hight);
    _mav_put_uint8_t(buf, 84, magnFlg);
    _mav_put_uint8_t(buf, 85, HbarFlg);
    _mav_put_uint8_t(buf, 86, mode);
    _mav_put_uint8_t(buf, 87, scene);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PRICISE_IMU, buf, MAVLINK_MSG_ID_PRICISE_IMU_MIN_LEN, MAVLINK_MSG_ID_PRICISE_IMU_LEN, MAVLINK_MSG_ID_PRICISE_IMU_CRC);
#else
    mavlink_pricise_imu_t *packet = (mavlink_pricise_imu_t *)msgbuf;
    packet->time_boot_ms = time_boot_ms;
    packet->xgyro = xgyro;
    packet->ygyro = ygyro;
    packet->zgyro = zgyro;
    packet->xacc = xacc;
    packet->yacc = yacc;
    packet->zacc = zacc;
    packet->xmagn = xmagn;
    packet->ymagn = ymagn;
    packet->zmagn = zmagn;
    packet->Hbar = Hbar;
    packet->pitch = pitch;
    packet->roll = roll;
    packet->yaw = yaw;
    packet->vel_e = vel_e;
    packet->vel_n = vel_n;
    packet->vel_u = vel_u;
    packet->longitude = longitude;
    packet->latitude = latitude;
    packet->hight = hight;
    packet->magnFlg = magnFlg;
    packet->HbarFlg = HbarFlg;
    packet->mode = mode;
    packet->scene = scene;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PRICISE_IMU, (const char *)packet, MAVLINK_MSG_ID_PRICISE_IMU_MIN_LEN, MAVLINK_MSG_ID_PRICISE_IMU_LEN, MAVLINK_MSG_ID_PRICISE_IMU_CRC);
#endif
}
#endif

#endif

// MESSAGE PRICISE_IMU UNPACKING


/**
 * @brief Get field time_boot_ms from pricise_imu message
 *
 * @return [ms] Timestamp (time since system boot).
 */
static inline uint64_t mavlink_msg_pricise_imu_get_time_boot_ms(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint64_t(msg,  0);
}

/**
 * @brief Get field xgyro from pricise_imu message
 *
 * @return  The x axis gyro(-838.8608..838.8608).
 */
static inline float mavlink_msg_pricise_imu_get_xgyro(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  8);
}

/**
 * @brief Get field ygyro from pricise_imu message
 *
 * @return  The y axis gyro(-838.8608..838.8608).
 */
static inline float mavlink_msg_pricise_imu_get_ygyro(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  12);
}

/**
 * @brief Get field zgyro from pricise_imu message
 *
 * @return  The z axis gyro(-838.8608..838.8608).
 */
static inline float mavlink_msg_pricise_imu_get_zgyro(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  16);
}

/**
 * @brief Get field xacc from pricise_imu message
 *
 * @return  The x axis acc(-83.88608..83.88608).
 */
static inline float mavlink_msg_pricise_imu_get_xacc(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  20);
}

/**
 * @brief Get field yacc from pricise_imu message
 *
 * @return  The y axis acc(-83.88608..83.88608).
 */
static inline float mavlink_msg_pricise_imu_get_yacc(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  24);
}

/**
 * @brief Get field zacc from pricise_imu message
 *
 * @return  The z axis acc(-83.88608..83.88608).
 */
static inline float mavlink_msg_pricise_imu_get_zacc(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  28);
}

/**
 * @brief Get field xmagn from pricise_imu message
 *
 * @return  The x axis magn(-327.68..327.68).
 */
static inline float mavlink_msg_pricise_imu_get_xmagn(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  32);
}

/**
 * @brief Get field ymagn from pricise_imu message
 *
 * @return  The y axis magn(-327.68..327.68).
 */
static inline float mavlink_msg_pricise_imu_get_ymagn(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  36);
}

/**
 * @brief Get field zmagn from pricise_imu message
 *
 * @return  The z axis magn(-327.68..327.68).
 */
static inline float mavlink_msg_pricise_imu_get_zmagn(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  40);
}

/**
 * @brief Get field magnFlg from pricise_imu message
 *
 * @return  valid component(0:invalid 1:valid).
 */
static inline uint8_t mavlink_msg_pricise_imu_get_magnFlg(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  84);
}

/**
 * @brief Get field Hbar from pricise_imu message
 *
 * @return  The Hbar(0..6553.6).
 */
static inline float mavlink_msg_pricise_imu_get_Hbar(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  44);
}

/**
 * @brief Get field HbarFlg from pricise_imu message
 *
 * @return  valid component(0:invalid 1:valid).
 */
static inline uint8_t mavlink_msg_pricise_imu_get_HbarFlg(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  85);
}

/**
 * @brief Get field pitch from pricise_imu message
 *
 * @return  The pitch(-90..90).
 */
static inline float mavlink_msg_pricise_imu_get_pitch(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  48);
}

/**
 * @brief Get field roll from pricise_imu message
 *
 * @return  The roll(-180..180).
 */
static inline float mavlink_msg_pricise_imu_get_roll(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  52);
}

/**
 * @brief Get field yaw from pricise_imu message
 *
 * @return  The yaw(0,360).
 */
static inline float mavlink_msg_pricise_imu_get_yaw(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  56);
}

/**
 * @brief Get field vel_e from pricise_imu message
 *
 * @return  The east vel(-838.8608..838.8608).
 */
static inline float mavlink_msg_pricise_imu_get_vel_e(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  60);
}

/**
 * @brief Get field vel_n from pricise_imu message
 *
 * @return  The north vel(-838.8608..838.8608).
 */
static inline float mavlink_msg_pricise_imu_get_vel_n(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  64);
}

/**
 * @brief Get field vel_u from pricise_imu message
 *
 * @return  The up vel(-838.8608..838.8608).
 */
static inline float mavlink_msg_pricise_imu_get_vel_u(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  68);
}

/**
 * @brief Get field longitude from pricise_imu message
 *
 * @return  The longitude(-838.8608..838.8608).
 */
static inline float mavlink_msg_pricise_imu_get_longitude(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  72);
}

/**
 * @brief Get field latitude from pricise_imu message
 *
 * @return  latitude(-838.8608..838.8608).
 */
static inline float mavlink_msg_pricise_imu_get_latitude(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  76);
}

/**
 * @brief Get field hight from pricise_imu message
 *
 * @return  The hight(-838.8608..838.8608).
 */
static inline float mavlink_msg_pricise_imu_get_hight(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  80);
}

/**
 * @brief Get field mode from pricise_imu message
 *
 * @return  mode component(1..3).
 */
static inline uint8_t mavlink_msg_pricise_imu_get_mode(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  86);
}

/**
 * @brief Get field scene from pricise_imu message
 *
 * @return  scene component(1..5).
 */
static inline uint8_t mavlink_msg_pricise_imu_get_scene(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  87);
}

/**
 * @brief Decode a pricise_imu message into a struct
 *
 * @param msg The message to decode
 * @param pricise_imu C-struct to decode the message contents into
 */
static inline void mavlink_msg_pricise_imu_decode(const mavlink_message_t* msg, mavlink_pricise_imu_t* pricise_imu)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    pricise_imu->time_boot_ms = mavlink_msg_pricise_imu_get_time_boot_ms(msg);
    pricise_imu->xgyro = mavlink_msg_pricise_imu_get_xgyro(msg);
    pricise_imu->ygyro = mavlink_msg_pricise_imu_get_ygyro(msg);
    pricise_imu->zgyro = mavlink_msg_pricise_imu_get_zgyro(msg);
    pricise_imu->xacc = mavlink_msg_pricise_imu_get_xacc(msg);
    pricise_imu->yacc = mavlink_msg_pricise_imu_get_yacc(msg);
    pricise_imu->zacc = mavlink_msg_pricise_imu_get_zacc(msg);
    pricise_imu->xmagn = mavlink_msg_pricise_imu_get_xmagn(msg);
    pricise_imu->ymagn = mavlink_msg_pricise_imu_get_ymagn(msg);
    pricise_imu->zmagn = mavlink_msg_pricise_imu_get_zmagn(msg);
    pricise_imu->Hbar = mavlink_msg_pricise_imu_get_Hbar(msg);
    pricise_imu->pitch = mavlink_msg_pricise_imu_get_pitch(msg);
    pricise_imu->roll = mavlink_msg_pricise_imu_get_roll(msg);
    pricise_imu->yaw = mavlink_msg_pricise_imu_get_yaw(msg);
    pricise_imu->vel_e = mavlink_msg_pricise_imu_get_vel_e(msg);
    pricise_imu->vel_n = mavlink_msg_pricise_imu_get_vel_n(msg);
    pricise_imu->vel_u = mavlink_msg_pricise_imu_get_vel_u(msg);
    pricise_imu->longitude = mavlink_msg_pricise_imu_get_longitude(msg);
    pricise_imu->latitude = mavlink_msg_pricise_imu_get_latitude(msg);
    pricise_imu->hight = mavlink_msg_pricise_imu_get_hight(msg);
    pricise_imu->magnFlg = mavlink_msg_pricise_imu_get_magnFlg(msg);
    pricise_imu->HbarFlg = mavlink_msg_pricise_imu_get_HbarFlg(msg);
    pricise_imu->mode = mavlink_msg_pricise_imu_get_mode(msg);
    pricise_imu->scene = mavlink_msg_pricise_imu_get_scene(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_PRICISE_IMU_LEN? msg->len : MAVLINK_MSG_ID_PRICISE_IMU_LEN;
        memset(pricise_imu, 0, MAVLINK_MSG_ID_PRICISE_IMU_LEN);
    memcpy(pricise_imu, _MAV_PAYLOAD(msg), len);
#endif
}
